Fix change notification for event controllers
authorMatthias Clasen <mclasen@redhat.com>
Mon, 22 Jun 2020 16:46:12 +0000 (12:46 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 22 Jun 2020 16:46:12 +0000 (12:46 -0400)
We were adding event controllers at the end, but
announcing a change at the beginning, in
gtk_widget_add_controller. Fix that by emitting
::items-changed for the position where we actually
inserted the controller.

gtk/gtkwidget.c

index 55127a2ed7908971df1e88cc94ad5984df794e5e..2cedb2508f55ea6c3e347543ec5172b05e965df1 100644 (file)
@@ -11412,7 +11412,7 @@ gtk_widget_add_controller (GtkWidget          *widget,
   g_ptr_array_add (priv->controllers, controller);
 
   if (priv->controller_observer)
-    gtk_list_list_model_item_added_at (priv->controller_observer, 0);
+    gtk_list_list_model_item_added_at (priv->controller_observer, priv->controllers->len - 1);
 }
 
 /**